﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using octopus_project.enumeration;
using octopus_project;
using octopus_project.screen;

namespace octopus_project.scene.war {
    class War_Cursor : Cursor_GameplayEntry {

        public War_Cursor (GameScreen gameScreen, Player ownerPlayer)
            : base(gameScreen, ownerPlayer) {
        }


        public override void Update () {
        }

        /// <summary>
        /// Description.
        /// </summary>
        public override void Draw () {
            spriteBatch.Begin();        
            spriteBatch.Draw(
                        WarPhaseSpriteExtensions.SpriteImage,
                        new Rectangle(PositionX, PositionY, Constant.TILE_IMAG_SIDE, Constant.TILE_IMAG_SIDE),
                        WarPhaseSprite.PLAYER_CURSOR.GetSourceRectangle(ownerPlayer.Color),
                        Color.White);
            spriteBatch.End();
        }

        public int cursorPositionX() {
            if (positionX > 0) {
                return (int)((positionX + (Constant.TILE_SIDE )) / Constant.TILE_SIDE);
            }
            return 0;
        }

        public int cursorPositionY() {
            if (positionY > 0) {
                return (int)((positionY + (Constant.TILE_SIDE)) / Constant.TILE_SIDE);
            }
            return 0;
        }
    }
}
